import request from '@/utils/request'

// 查询收入记录列表
export function listIncome(query) {
  return request({
    url: '/system/finance/income/list',
    method: 'get',
    params: query
  })
}

// 查询收入记录详细
export function getIncome(incomeId) {
  return request({
    url: '/system/finance/income/' + incomeId,
    method: 'get'
  })
}

// 新增收入记录
export function addIncome(data) {
  return request({
    url: '/system/finance/income',
    method: 'post',
    data: data
  })
}

// 修改收入记录
export function updateIncome(data) {
  return request({
    url: '/system/finance/income',
    method: 'put',
    data: data
  })
}

// 删除收入记录
export function delIncome(incomeId) {
  return request({
    url: '/system/finance/income/' + incomeId,
    method: 'delete'
  })
}

// 导出收入记录
export function exportIncome(query) {
  return request({
    url: '/system/finance/income/export',
    method: 'post',
    data: query
  })
}

// 统计收入金额
export function getIncomeAmount(query) {
  return request({
    url: '/system/finance/income/amount',
    method: 'get',
    params: query
  })
}

// 按分类统计收入
export function getIncomeByCategory(query) {
  return request({
    url: '/system/finance/income/category',
    method: 'get',
    params: query
  })
} 